package com.codeforces.gym.g100184;

import java.util.Scanner;

public class M {

	static Scanner scanner = new Scanner(System.in);
	static long A, N, from, to;

	public static void main(String[] args) {
		A = scanner.nextLong();
		N = scanner.nextLong();
		from = N - 1;
		to = N + A - 1;
		System.out.println(count(to) - count(from));
	}

	private static long count(long num) {
		long sum = 0;
		long tmp = 9;
		int ndig = 1;
		while (num > tmp) {
			sum += tmp * ndig;
			num -= tmp;
			tmp *= 10;
			ndig++;
		}
		sum += num * ndig;
		return sum;
	}

}
